<template>
	<view style="position: relative;overflow: hidden;">
		<image class="banner" :src= "configs + '/static/beer/index8.png'"></image>
		<view class="iconBox">
			<view class="icon" @click="toBook">
				<image class="iconImage" src="@/static/images/work/boox.png"></image>
				<view class="iconTxt">
					客户通讯录
				</view>
			</view>
			<view class="icon" @click="toMerNotes">
				<image class="iconImage" src="@/static/images/work/shop.png"></image>
				<view class="iconTxt">
					邀请商户
				</view>
			</view>
			<view class="icon" @click="toNotes">
				<image class="iconImage" src="@/static/images/work/shoopNotes.png"></image>
				<view class="iconTxt">
					邀请商户记录
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import config from '@/config'
	export default {
		name: "staffWork",
		data() {
			return {
configs:''
			};
		},
		created() {
			this.configs = config.baseUrl + ':19000'
		},
		methods: {
			//扫码
			toMerNotes() {
				let that = this
				// 允许从相机和相册扫码
				uni.scanCode({
					success: function(res) {
						// console.log('条码类型：' + res.scanType);
						// console.log('条码内容：' + res.result);
						if(res.scanType=='QR_CODE'){
							let parts = res.result.split('=');
							if(parts[0]=='id'){
								that.$tab.navigateTo('/pages/addUs/addUs?id=' + parts[1])
							}else{
								that.$modal.msgError("二维码错误")
							}
						}
					}
				});
			},
			//跳转邀请商户记录
			toNotes() {
				this.$tab.navigateTo('/pagesA/shopNotes/shopNotes')
			},
			//跳转通讯录
			toBook() {
				this.$tab.navigateTo('/pagesA/book/book')
			},
		},
	}
</script>

<style>
	.banner {
		width: 750rpx;
		position: absolute;
		top: 0;
		z-index: -1;
	}

	.iconBox {
		width: 690rpx;
		min-height: 216rpx;
		margin: 300rpx auto 0 auto;
		display: flex;
		justify-content: space-around;
		background-color: #ffffff;
		border-radius: 20rpx;
	}

	.icon {
		width: 150rpx;
		height: 156rpx;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		margin-top: 30rpx;
	}

	.iconImage {
		width: 96rpx;
		height: 96rpx;
	}

	.iconTxt {
		width: 170rpx;
		height: 40rpx;
		line-height: 40rpx;
		text-align: center;
		font-size: 28rpx;
		color: #666666;
	}
</style>